//
//  WebXinxiDetailViewController.m
//  jizhiyunduan
//
//  Created by 鞠超 on 16/6/29.
//  Copyright © 2016年 JC. All rights reserved.
//

#import "WebXinxiDetailViewController.h"

@interface WebXinxiDetailViewController () <UITableViewDelegate, UITableViewDataSource>

@property (nonatomic, strong) UITableView * tableView;

//
@property (nonatomic, strong) UILabel * company_name;
@property (nonatomic, strong) UILabel * company_type;
@property (nonatomic, strong) UILabel * company_number;
@property (nonatomic, strong) UILabel * company_website;
@property (nonatomic, strong) UILabel * company_date1;
@property (nonatomic, strong) UILabel * company_date2;
@property (nonatomic, strong) UILabel * company_keywords;
@property (nonatomic, strong) UILabel * baidu_shoulu;
@property (nonatomic, strong) UILabel * website_PR;
@property (nonatomic, strong) UILabel * website_IP;


@end

@implementation WebXinxiDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    [self p_navi];
    
    [self p_setupView];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - navi
- (void)p_navi
{
    _lblTitle.text = [NSString stringWithFormat:@"%@",self.str_webName];
    _lblTitle.font = [UIFont systemFontOfSize:20];
    
    _btnRight.hidden = YES;
    
    [self addLeftButton:@"fanhui@2x.png"];
}

//左返回
- (void)clickLeftButton:(UIButton *)sender
{
    [self.navigationController popViewControllerAnimated:YES];
}

//隐藏tabbar
-(void)viewWillAppear:(BOOL)animated
{
    [(AppDelegate *)[[UIApplication sharedApplication] delegate] hiddenTabBar];
}

#pragma mark - 布局
- (void)p_setupView
{
    self.view.backgroundColor = [UIColor groupTableViewBackgroundColor];
    
    self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 64, SCREEN_WIDTH, SCREEN_HEIGHT - 64) style:(UITableViewStylePlain)];
    
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    self.tableView.backgroundColor = [UIColor groupTableViewBackgroundColor];
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 30)];
    
    [self.view addSubview:self.tableView];
}

#pragma mark - tableView代理
- (NSInteger )numberOfSectionsInTableView:(UITableView *)tableView
{
    return 10;
}

- (NSInteger )tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 1;
}

- (CGFloat )tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 69;
}

- (UITableViewCell * )tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell * cell = [[UITableViewCell alloc] init];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    
    switch (indexPath.section)
    {
        case 0:
        {
            UIView * view_bg = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 30)];
            view_bg.backgroundColor = [UIColor groupTableViewBackgroundColor];
            [cell addSubview:view_bg];
            
            UILabel * lbl_1 = [[UILabel alloc] initWithFrame:CGRectMake(15, 5, SCREEN_WIDTH - 30, 20)];
            lbl_1.text = @"主办单位名称";
            [view_bg addSubview:lbl_1];
            
            self.company_name = [[UILabel alloc] initWithFrame:CGRectMake(15, 39.5, SCREEN_WIDTH - 25, 20)];
            self.company_name.text = @"山东智顺网络科技有限公司";
            self.company_name.font = [UIFont systemFontOfSize:15];
            [cell addSubview:self.company_name];
        }
            break;
        case 1:
        {
            UIView * view_bg = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 30)];
            view_bg.backgroundColor = [UIColor groupTableViewBackgroundColor];
            [cell addSubview:view_bg];
            
            UILabel * lbl_1 = [[UILabel alloc] initWithFrame:CGRectMake(15, 5, SCREEN_WIDTH - 30, 20)];
            lbl_1.text = @"主办单位性质";
            [view_bg addSubview:lbl_1];
            
            self.company_type = [[UILabel alloc] initWithFrame:CGRectMake(15, 39.5, SCREEN_WIDTH - 25, 20)];
            self.company_type.text = @"企业";
            self.company_type.font = [UIFont systemFontOfSize:15];
            [cell addSubview:self.company_type];
        }
            break;
        case 2:
        {
            UIView * view_bg = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 30)];
            view_bg.backgroundColor = [UIColor groupTableViewBackgroundColor];
            [cell addSubview:view_bg];
            
            UILabel * lbl_1 = [[UILabel alloc] initWithFrame:CGRectMake(15, 5, SCREEN_WIDTH - 30, 20)];
            lbl_1.text = @"网站备案/许可证号";
            [view_bg addSubview:lbl_1];
            
            self.company_type = [[UILabel alloc] initWithFrame:CGRectMake(15, 39.5, SCREEN_WIDTH - 25, 20)];
            self.company_type.text = @"京ICP备11011334号";
            self.company_type.font = [UIFont systemFontOfSize:15];
            [cell addSubview:self.company_type];
        }
            break;
        case 3:
        {
            UIView * view_bg = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 30)];
            view_bg.backgroundColor = [UIColor groupTableViewBackgroundColor];
            [cell addSubview:view_bg];
            
            UILabel * lbl_1 = [[UILabel alloc] initWithFrame:CGRectMake(15, 5, SCREEN_WIDTH - 30, 20)];
            lbl_1.text = @"网站域名";
            [view_bg addSubview:lbl_1];
            
            self.company_website = [[UILabel alloc] initWithFrame:CGRectMake(15, 39.5, SCREEN_WIDTH - 25, 20)];
            self.company_website.text = @"www.zhishun.net";
            self.company_website.font = [UIFont systemFontOfSize:15];
            [cell addSubview:self.company_website];
        }
            break;
        case 4:
        {
            UIView * view_bg = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 30)];
            view_bg.backgroundColor = [UIColor groupTableViewBackgroundColor];
            [cell addSubview:view_bg];
            
            UILabel * lbl_1 = [[UILabel alloc] initWithFrame:CGRectMake(15, 5, SCREEN_WIDTH - 30, 20)];
            lbl_1.text = @"网站IP";
            [view_bg addSubview:lbl_1];
            
            self.company_website = [[UILabel alloc] initWithFrame:CGRectMake(15, 39.5, SCREEN_WIDTH - 25, 20)];
            self.company_website.text = @"121.42.70.68";
            self.company_website.font = [UIFont systemFontOfSize:15];
            [cell addSubview:self.company_website];
        }
            break;
        case 5:
        {
            UIView * view_bg = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 30)];
            view_bg.backgroundColor = [UIColor groupTableViewBackgroundColor];
            [cell addSubview:view_bg];
            
            UILabel * lbl_1 = [[UILabel alloc] initWithFrame:CGRectMake(15, 5, SCREEN_WIDTH - 30, 20)];
            lbl_1.text = @"域名注册时间";
            [view_bg addSubview:lbl_1];
            
            self.company_date1 = [[UILabel alloc] initWithFrame:CGRectMake(15, 39.5, SCREEN_WIDTH - 25, 20)];
            self.company_date1.text = @"2007-01-13";
            self.company_date1.font = [UIFont systemFontOfSize:15];
            [cell addSubview:self.company_date1];
        }
            break;
        case 6:
        {
            UIView * view_bg = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 30)];
            view_bg.backgroundColor = [UIColor groupTableViewBackgroundColor];
            [cell addSubview:view_bg];
            
            UILabel * lbl_1 = [[UILabel alloc] initWithFrame:CGRectMake(15, 5, SCREEN_WIDTH - 30, 20)];
            lbl_1.text = @"域名到期时间";
            [view_bg addSubview:lbl_1];
            
            self.company_date2 = [[UILabel alloc] initWithFrame:CGRectMake(15, 39.5, SCREEN_WIDTH - 25, 20)];
            self.company_date2.text = @"2019-01-12";
            self.company_date2.font = [UIFont systemFontOfSize:15];
            [cell addSubview:self.company_date2];
        }
            break;
        case 7:
        {
            UIView * view_bg = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 30)];
            view_bg.backgroundColor = [UIColor groupTableViewBackgroundColor];
            [cell addSubview:view_bg];
            
            UILabel * lbl_1 = [[UILabel alloc] initWithFrame:CGRectMake(15, 5, SCREEN_WIDTH - 30, 20)];
            lbl_1.text = @"关键词个数";
            [view_bg addSubview:lbl_1];
            
            self.company_keywords = [[UILabel alloc] initWithFrame:CGRectMake(15, 39.5, SCREEN_WIDTH - 25, 20)];
            self.company_keywords.text = @"5";
            self.company_keywords.font = [UIFont systemFontOfSize:15];
            [cell addSubview:self.company_keywords];
        }
            break;
        case 8:
        {
            UIView * view_bg = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 30)];
            view_bg.backgroundColor = [UIColor groupTableViewBackgroundColor];
            [cell addSubview:view_bg];
            
            UILabel * lbl_1 = [[UILabel alloc] initWithFrame:CGRectMake(15, 5, SCREEN_WIDTH - 30, 20)];
            lbl_1.text = @"百度收录量";
            [view_bg addSubview:lbl_1];
            
            self.baidu_shoulu = [[UILabel alloc] initWithFrame:CGRectMake(15, 39.5, SCREEN_WIDTH - 25, 20)];
            self.baidu_shoulu.text = @"888";
            self.baidu_shoulu.font = [UIFont systemFontOfSize:15];
            [cell addSubview:self.baidu_shoulu];
        }
            break;
        case 9:
        {
            UIView * view_bg = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 30)];
            view_bg.backgroundColor = [UIColor groupTableViewBackgroundColor];
            [cell addSubview:view_bg];
            
            UILabel * lbl_1 = [[UILabel alloc] initWithFrame:CGRectMake(15, 5, SCREEN_WIDTH - 30, 20)];
            lbl_1.text = @"网站PR值";
            [view_bg addSubview:lbl_1];
            
            self.website_PR = [[UILabel alloc] initWithFrame:CGRectMake(15, 39.5, SCREEN_WIDTH - 25, 20)];
            self.website_PR.text = @"6";
            self.website_PR.font = [UIFont systemFontOfSize:15];
            [cell addSubview:self.website_PR];
        }
            break;
        default:
            break;
    }
    
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
}

//- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
//{
//    switch (section)
//    {
//        case 0:
//        {
//            return @"主办单位名称";
//        }
//            break;
//        case 1:
//        {
//            return @"主办单位性质";
//        }
//            break;
//        case 2:
//        {
//            return @"网站备案/许可证号";
//        }
//            break;
//        case 3:
//        {
//            return @"网站域名";
//        }
//            break;
//        case 4:
//        {
//            return @"域名注册时间";
//        }
//            break;
//        case 5:
//        {
//            return @"域名到期时间";
//        }
//            break;
//        case 6:
//        {
//            return @"关键词个数";
//        }
//            break;
//        case 7:
//        {
//            return @"百度收录量";
//        }
//            break;
//        case 8:
//        {
//            return @"网站PR值";
//        }
//            break;
//        default:
//            return @"";
//            break;
//    }
//}






@end
